package com.itheima.day07.demo08;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {
    public static void main(String[] args) {
       /* Thread thread = new Thread();
        thread.start();*/

        new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {

                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
                    Date date = new Date();
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }

                    System.out.println(simpleDateFormat.format(date));

                }
            }
        }.start();
    }


}
